import request from '@/utils/request'
function get ({ url, data }) {
  return request({
    url,
    params: data
  })
}

function jsonPost ({ url, data }) {
  return request({
    url,
    data: JSON.stringify(data),
    method: 'post',
    headers: {
      'Content-Type': 'Application/json'
    }
  })
}

function formPost ({ url, data }) {
  return request({ url, data, method: 'post' })
}
function formDataPost ({ url, data }) {
  return request({
    url,
    data,
    method: 'post',
    headers: {
      'Content-Type': 'multipart/form-data'
    }
  })
}

export {
  get, jsonPost, formPost, formDataPost
}
